<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <title>登录</title>
    <link rel="stylesheet" type="text/css" href="__STATIC__/libs/layui/css/layui.css" />
    <link rel="stylesheet" type="text/css" href="__STATIC__/admin/css/style.css?t=1590725734" />
    <script language="JavaScript">
        <!--
    if(top!=self)
    if(self!=top) top.location=self.location;
//-->
</script>
    <style type="text/css">
    body {
        background-repeat: no-repeat;
        background-color: #f1f4fd;
        background-size: cover;
        background-image: url(__STATIC__/admin/img/bg.png);
    }
    </style>
    {:hook('admin_login_style')}
</head>

<body>
    <div id="mydiv">
        <div class="login-main">
            <div class="layui-elip">YZNCMS管理系统&nbsp;<span class="version">v{$Think.config.version.yzncms_version}</span><span class="bg1"></span><span class="bg2"></span></div>
            <form class="layui-form" action="{:url('login')}">
                {:token()}
                <div class="login-container">
                    <div class="layui-form-item">
                        <div class="layui-input-wrap">
                            <div class="layui-input-prefix">
                                <i class="layui-icon layui-icon-username"></i>
                            </div>
                            <input type="text" name="username" lay-verify="required" autocomplete="off" placeholder="账号" class="layui-input" lay-affix="clear">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-wrap">
                            <div class="layui-input-prefix">
                                <i class="layui-icon layui-icon-password"></i>
                            </div>
                            <input type="password" name="password" lay-verify="required" autocomplete="off" placeholder="密码" class="layui-input" lay-affix="eye">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-wrap verify-box">
                            <div class="layui-input-prefix">
                                <i class="layui-icon layui-icon-vercode"></i>
                            </div>
                            <input type="text" name="verify" lay-verify="required" placeholder="验证码" autocomplete="off" class="layui-input">
                            <img id="verify" src="{:captcha_src()}" alt="验证码" class="captcha">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <input type="checkbox" name="keeplogin" title="保持会话" lay-skin="primary">
                    </div>
                    <div class="layui-form-item login-btn">
                        <button class="layui-btn layui-btn-normal layui-btn-fluid" lay-submit>登录</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <script type="text/javascript" src="__STATIC__/libs/layui/layui.js"></script>
    <script src="__STATIC__/libs/jquery/jquery.min.js"></script>
    {include file='layui' /}
    <script type="text/javascript">
    layui.use(['form', 'layer', 'yznForm'], function() {
        var form = layui.form,
            layer = layui.layer,
            yznForm = layui.yznForm;

        yznForm.listen('', function(res) {
            layer.msg('登入成功', {
                offset: '15px',
                icon: 1,
                time: 1000
            }, function() {
                window.location.href = res.url;
            });
            return false;
        }, function(res) {
            $("#verify").click();
        });
    });
    //刷新验证码
    $("#verify").click(function() {
        var verifyimg = $("#verify").attr("src");
        $("#verify").attr("src", verifyimg.replace(/\?.*$/, '') + '?' + Math.random());
    });
    </script>
    {:hook('admin_login_form')}
</body>

</html>